A Red Negatives report shows negative values in red color if those values meet the requirements set in a conditional expression. The following steps demonstrate how to create a report with negative values in red negatives.
These steps assume that you have already added a Page Report template to your project, connected it to a data source and added a DataSet. See Adding an ActiveReport to a Project, Connect to a Data Source and Add a Dataset for more information.
- From the Visual Studio toolbox, drag and drop a Table data region onto the design surface and place fields inside the cells of the details row.
- In the same Table, select any cell (Textbox) that displays integer values and right click to select Properties.
- In the Properties Window that appears, set the following expression in the Color property:
=iif(Fields!FieldName.Value < 0, "Red", "Black")
Note: In the expression above, FieldName refers to field that the textbox contains. For example, if a textbox contains the Rollup field, the expression looks like: =iif(Fields!Rollup.Value < 0, "Red", "Black")
- Go to the Preview tab and view the result.
The following image illustrates a report that contains negative values in red: